home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1993-10-23 | 2.3 KB | [ TEXT/KAHL]
open in: MacOS 8.1
extracted
|
Win98
extracted
|
DOS
extracted
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary ).
You can browse this item here: THINKProc.c
Confidence Program Detection Match Type Support
66%
dexvert
Compact Compressed (Unix) (archive/compact)
ext
Supported
10%
dexvert
MacBinary (archive/macBinary)
fallback
Supported
1%
dexvert
Text File (text/txt)
fallback
Supported
100%
file
MacBinary II, Sat Oct 23 18:02:11 1993, modified Sat Oct 23 18:02:11 1993, creator Think C, type ASCII, 1580 bytes "THINKProc.c" , at 0x6ac 390 bytes resource
default (weak)
99%
file
data
default
74%
TrID
Macintosh plain text (MacBinary)
default
25%
TrID
MacBinary 2
default (weak)
100%
siegfried
fmt/1762 MacBinary (II)
default
100%
lsar
MacBinary
default
id metadata key value macFileType [ TEXT] macFileCreator [ KAHL]
hex view +--------+-------------------------+-------------------------+--------+--------+ |00000000| 00 0b 54 48 49 4e 4b 50 | 72 6f 63 2e 63 00 00 00 |..THINKP|roc.c...| |00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00000040| 00 54 45 58 54 4b 41 48 | 4c 00 00 00 00 00 00 00 |.TEXTKAH|L.......| |00000050| 00 00 00 00 00 06 2c 00 | 00 01 86 a8 ef 5a 63 a8 |......,.|.....Zc.| |00000060| ef 5a 63 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.Zc.....|........| |00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 d2 0b 00 00 |........|........| |00000080| 2f 2a 0d 20 2a 09 54 48 | 49 4e 4b 50 72 6f 63 2e |/*. *.TH|INKProc.| |00000090| 63 20 62 79 20 50 65 74 | 65 20 52 65 73 6e 69 63 |c by Pet|e Resnic| |000000a0| 6b 2e 20 54 68 69 73 20 | 73 6f 75 72 63 65 20 66 |k. This |source f| |000000b0| 69 6c 65 20 73 68 6f 75 | 6c 64 20 62 65 20 63 6f |ile shou|ld be co| |000000c0| 6d 70 69 6c 65 64 20 69 | 6e 0d 20 2a 09 54 48 49 |mpiled i|n. *.THI| |000000d0| 4e 4b 20 43 20 69 6e 20 | 61 20 73 65 70 65 72 61 |NK C in |a sepera| |000000e0| 74 65 20 70 72 6f 6a 65 | 63 74 20 61 73 20 61 20 |te proje|ct as a | |000000f0| 63 6f 64 65 20 72 65 73 | 6f 75 72 63 65 2e 20 54 |code res|ource. T| |00000100| 68 65 20 72 65 73 6f 75 | 72 63 65 20 74 79 70 65 |he resou|rce type| |00000110| 0d 20 2a 09 69 73 20 64 | 65 66 69 6e 65 64 20 69 |. *.is d|efined i| |00000120| 6e 20 64 72 69 76 65 72 | 2e 63 20 61 73 20 27 50 |n driver|.c as 'P| |00000130| 52 4f 43 27 20 61 6e 64 | 20 74 68 65 20 72 65 73 |ROC' and| the res| |00000140| 6f 75 72 63 65 20 49 44 | 20 69 73 20 64 65 66 69 |ource ID| is defi| |00000150| 6e 65 64 20 61 73 20 31 | 32 38 0d 20 2a 09 69 6e |ned as 1|28. *.in| |00000160| 20 64 72 76 72 69 6e 63 | 6c 75 64 65 73 2e 68 2e | drvrinc|ludes.h.| |00000170| 20 54 68 65 20 49 44 20 | 63 61 6e 62 65 20 63 68 | The ID |canbe ch| |00000180| 61 6e 67 65 64 20 69 66 | 20 6e 65 63 65 73 73 61 |anged if| necessa| |00000190| 72 79 2e 20 54 68 69 73 | 20 63 6f 64 65 0d 20 2a |ry. This| code. *| |000001a0| 09 61 63 74 75 61 6c 6c | 79 20 72 65 70 6c 61 63 |.actuall|y replac| |000001b0| 65 73 20 74 68 65 20 63 | 61 6c 6c 20 74 6f 20 47 |es the c|all to G| |000001c0| 65 74 52 65 73 6f 75 72 | 63 65 20 69 6e 20 54 48 |etResour|ce in TH| |000001d0| 49 4e 4b 20 43 27 73 20 | 64 72 69 76 65 72 20 67 |INK C's |driver g| |000001e0| 6c 75 65 2e 0d 20 2a 09 | 49 6e 73 74 65 61 64 20 |lue.. *.|Instead | |000001f0| 6f 66 20 74 68 65 20 64 | 72 69 76 65 72 20 44 41 |of the d|river DA| |00000200| 54 41 20 72 65 73 6f 75 | 72 63 65 20 61 6e 64 20 |TA resou|rce and | |00000210| 6d 75 6c 74 69 2d 73 65 | 67 6d 65 6e 74 20 44 43 |multi-se|gment DC| |00000220| 4f 44 20 72 65 73 6f 75 | 72 63 65 73 0d 20 2a 09 |OD resou|rces. *.| |00000230| 62 65 69 6e 67 20 69 6e | 20 74 68 65 20 64 72 69 |being in| the dri| |00000240| 76 65 72 27 73 20 72 65 | 73 6f 75 72 63 65 20 66 |ver's re|source f| |00000250| 69 6c 65 2c 20 74 68 65 | 79 20 61 72 65 20 64 65 |ile, the|y are de| |00000260| 74 61 63 68 65 64 20 68 | 61 6e 64 6c 65 73 20 69 |tached h|andles i| |00000270| 6e 20 74 68 65 0d 20 2a | 09 73 79 73 74 65 6d 20 |n the. *|.system | |00000280| 68 65 61 70 20 61 6e 64 | 20 61 72 65 20 6c 69 74 |heap and| are lit| |00000290| 65 72 61 6c 6c 79 20 22 | 74 61 63 6b 65 64 20 6f |erally "|tacked o| |000002a0| 6e 22 20 74 6f 20 74 68 | 65 20 62 6f 74 74 6f 6d |n" to th|e bottom| |000002b0| 20 6f 66 20 74 68 69 73 | 20 70 69 65 63 65 0d 20 | of this| piece. | |000002c0| 2a 09 6f 66 20 63 6f 64 | 65 3a 20 61 74 74 61 63 |*.of cod|e: attac| |000002d0| 68 65 64 20 74 6f 20 74 | 68 65 20 65 6e 64 20 6f |hed to t|he end o| |000002e0| 66 20 74 68 65 20 70 6f | 69 6e 74 65 72 20 63 6f |f the po|inter co| |000002f0| 6e 74 61 69 6e 69 6e 67 | 20 2a 54 48 49 53 2a 20 |ntaining| *THIS* | |00000300| 63 6f 64 65 20 69 73 0d | 20 2a 09 61 6e 20 61 72 |code is.| *.an ar| |00000310| 72 61 79 20 6f 66 20 68 | 61 6e 64 6c 65 73 20 61 |ray of h|andles a| |00000320| 6e 64 20 72 65 73 6f 75 | 72 63 65 20 49 44 27 73 |nd resou|rce ID's| |00000330| 2e 20 54 68 65 20 63 6f | 64 65 20 72 65 74 75 72 |. The co|de retur| |00000340| 6e 73 20 74 68 65 20 68 | 61 6e 64 6c 65 20 74 6f |ns the h|andle to| |00000350| 0d 20 2a 09 74 68 65 20 | 63 6f 72 72 65 63 74 20 |. *.the |correct | |00000360| 64 65 74 61 63 68 65 64 | 20 72 65 73 6f 75 72 63 |detached| resourc| |00000370| 65 2e 0d 20 2a 2f 0d 0d | 23 69 6e 63 6c 75 64 65 |e.. */..|#include| |00000380| 20 22 64 72 76 72 69 6e | 63 6c 75 64 65 73 2e 68 | "drvrin|cludes.h| |00000390| 22 0d 23 69 6e 63 6c 75 | 64 65 20 3c 53 65 74 55 |".#inclu|de <SetU| |000003a0| 70 41 34 2e 68 3e 0d 0d | 2f 2a 0d 20 2a 09 47 6c |pA4.h>..|/*. *.Gl| |000003b0| 6f 62 61 6c 20 76 61 72 | 69 61 62 6c 65 73 20 61 |obal var|iables a| |000003c0| 72 65 20 73 74 6f 72 65 | 64 20 61 74 20 74 68 65 |re store|d at the| |000003d0| 20 65 6e 64 20 6f 66 20 | 74 68 65 20 63 6f 64 65 | end of |the code| |000003e0| 20 73 65 67 6d 65 6e 74 | 2e 20 57 69 74 68 0d 20 | segment|. With. | |000003f0| 2a 09 72 65 73 52 65 63 | 2c 20 77 65 20 68 61 76 |*.resRec|, we hav| |00000400| 65 20 61 20 7a 65 72 6f | 2d 66 69 6c 6c 65 64 20 |e a zero|-filled | |00000410| 73 74 72 75 63 74 75 72 | 65 20 61 74 20 74 68 65 |structur|e at the| |00000420| 20 65 6e 64 20 6f 66 20 | 74 68 65 20 63 6f 64 65 | end of |the code| |00000430| 20 73 65 67 6d 65 6e 74 | 0d 20 2a 09 77 68 69 63 | segment|. *.whic| |00000440| 68 20 63 61 6e 20 73 65 | 72 76 65 72 20 61 73 20 |h can se|rver as | |00000450| 61 20 6d 61 72 6b 65 72 | 2e 0d 20 2a 2f 0d 52 73 |a marker|.. */.Rs| |00000460| 72 63 52 65 63 20 72 65 | 73 52 65 63 20 3d 20 7b |rcRec re|sRec = {| |00000470| 6e 69 6c 2c 20 30 2c 20 | 30 7d 3b 0d 0d 70 61 73 |nil, 0, |0};..pas| |00000480| 63 61 6c 20 48 61 6e 64 | 6c 65 20 6d 61 69 6e 28 |cal Hand|le main(| |00000490| 52 65 73 54 79 70 65 20 | 74 68 65 54 79 70 2c 20 |ResType |theTyp, | |000004a0| 73 68 6f 72 74 20 74 68 | 65 49 44 29 0d 7b 0d 09 |short th|eID).{..| |000004b0| 53 69 7a 65 20 74 68 65 | 53 69 7a 65 3b 0d 09 52 |Size the|Size;..R| |000004c0| 73 72 63 52 65 63 20 2a | 72 65 73 50 74 72 3b 0d |srcRec *|resPtr;.| |000004d0| 09 50 74 72 20 63 6f 64 | 65 50 74 72 3b 0d 09 0d |.Ptr cod|ePtr;...| |000004e0| 09 52 65 6d 65 6d 62 65 | 72 41 30 28 29 3b 0d 09 |.Remembe|rA0();..| |000004f0| 53 65 74 55 70 41 34 28 | 29 3b 0d 09 0d 09 2f 2a |SetUpA4(|);..../*| |00000500| 20 47 65 74 20 74 68 65 | 20 73 74 61 72 74 69 6e | Get the| startin| |00000510| 67 20 61 64 64 72 65 73 | 73 20 6f 66 20 74 68 65 |g addres|s of the| |00000520| 20 63 6f 64 65 20 73 65 | 67 6d 65 6e 74 20 2a 2f | code se|gment */| |00000530| 0d 09 61 73 6d 20 7b 20 | 6d 6f 76 65 2e 6c 20 61 |..asm { |move.l a| |00000540| 34 2c 20 63 6f 64 65 50 | 74 72 20 7d 0d 09 0d 09 |4, codeP|tr }....| |00000550| 2f 2a 20 46 69 67 75 72 | 65 20 6f 75 74 20 68 6f |/* Figur|e out ho| |00000560| 77 20 62 69 67 20 74 68 | 65 20 70 6f 69 6e 74 65 |w big th|e pointe| |00000570| 72 20 69 73 20 61 6e 64 | 20 73 74 61 72 74 20 61 |r is and| start a| |00000580| 74 20 74 68 65 20 65 6e | 64 20 2a 2f 0d 09 74 68 |t the en|d */..th| |00000590| 65 53 69 7a 65 20 3d 20 | 47 65 74 50 74 72 53 69 |eSize = |GetPtrSi| |000005a0| 7a 65 28 63 6f 64 65 50 | 74 72 29 3b 0d 09 72 65 |ze(codeP|tr);..re| |000005b0| 73 50 74 72 20 3d 20 28 | 52 73 72 63 52 65 63 20 |sPtr = (|RsrcRec | |000005c0| 2a 29 28 63 6f 64 65 50 | 74 72 20 2b 20 74 68 65 |*)(codeP|tr + the| |000005d0| 53 69 7a 65 29 3b 0d 09 | 0d 09 2f 2a 20 4c 6f 6f |Size);..|../* Loo| |000005e0| 6b 20 66 6f 72 20 74 68 | 65 20 68 61 6e 64 6c 65 |k for th|e handle| |000005f0| 20 77 69 74 68 20 74 68 | 65 20 63 6f 72 72 65 63 | with th|e correc| |00000600| 74 20 72 65 73 6f 75 72 | 63 65 20 49 44 20 2a 2f |t resour|ce ID */| |00000610| 0d 09 77 68 69 6c 65 28 | 28 28 2d 2d 72 65 73 50 |..while(|((--resP| |00000620| 74 72 29 2d 3e 72 73 72 | 63 20 21 3d 20 6e 69 6c |tr)->rsr|c != nil| |00000630| 29 20 26 26 0d 09 20 20 | 20 20 20 20 28 28 72 65 |) &&.. | ((re| |00000640| 73 50 74 72 2d 3e 69 64 | 20 21 3d 20 74 68 65 49 |sPtr->id| != theI| |00000650| 44 29 20 7c 7c 20 28 72 | 65 73 50 74 72 2d 3e 74 |D) || (r|esPtr->t| |00000660| 79 70 20 21 3d 20 74 68 | 65 54 79 70 29 29 29 0d |yp != th|eTyp))).| |00000670| 09 09 2f 2a 20 44 6f 20 | 6e 6f 74 68 69 6e 67 20 |../* Do |nothing | |00000680| 2a 2f 20 3b 0d 09 52 65 | 73 74 6f 72 65 41 34 28 |*/ ;..Re|storeA4(| |00000690| 29 3b 0d 09 72 65 74 75 | 72 6e 28 72 65 73 50 74 |);..retu|rn(resPt| |000006a0| 72 2d 3e 72 73 72 63 29 | 3b 0d 7d 0d 00 00 00 00 |r->rsrc)|;.}.....| |000006b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |000006c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |000006d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |000006e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |000006f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00000700| 00 00 01 00 00 00 01 2c | 00 00 00 2c 00 00 00 5a |.......,|...,...Z| |00000710| 65 73 4c 69 73 74 00 1c | 00 00 3a a7 01 e8 00 1d |esList..|..:.....| |00000720| 95 5a 00 00 0d 2a 67 65 | 74 52 65 73 50 61 74 63 |.Z...*ge|tResPatc| |00000730| 0b 54 48 49 4e 4b 50 72 | 6f 63 2e 63 02 00 00 00 |.THINKPr|oc.c....| |00000740| 50 61 72 74 53 49 54 78 | 00 00 00 00 00 00 00 00 |PartSITx|........| |00000750| 00 00 50 61 72 74 53 49 | 54 78 00 00 00 00 00 00 |..PartSI|Tx......| |00000760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00000770| 00 00 a9 80 18 35 00 00 | 00 00 00 00 01 86 01 74 |.....5..|.......t| |00000780| 00 00 00 b6 00 2f 07 a0 | 08 16 00 00 00 1c 00 a6 |...../..|........| |00000790| 00 04 53 5f 57 50 00 00 | 00 2a 44 54 56 55 00 02 |..S_WP..|.*DTVU..| |000007a0| 00 36 42 4b 50 54 00 01 | 00 5a 45 46 4e 54 00 00 |.6BKPT..|.ZEFNT..| |000007b0| 00 72 45 54 41 42 00 00 | 00 7e 2a 16 00 00 00 00 |.rETAB..|.~*.....| |000007c0| 00 00 00 00 00 00 31 83 | ff ff 00 00 00 0e 00 00 |......1.|........| |000007d0| 00 00 7a f5 ff ff 00 00 | 00 4c 00 00 00 00 06 2a |..z.....|.L.....*| |000007e0| ff ff 00 00 01 40 00 00 | 00 00 1b a0 ff ff 00 00 |.....@..|........| |000007f0| 00 2a 00 00 00 00 4d 13 | ff ff 00 00 01 32 00 00 |.*....M.|.....2..| |00000800| 00 00 00 14 00 01 00 00 | 04 0b 00 00 04 0f 09 00 |........|........| |00000810| 00 00 31 20 6d 61 69 6e | 00 00 00 04 00 06 00 04 |..1 main|........| |00000820| 00 00 00 08 00 09 04 43 | 6f 64 65 ff 00 00 01 00 |.......C|ode.....| |00000830| 00 00 01 2c 00 00 00 2c | 00 00 00 5a 00 42 19 8c |...,...,|...Z.B..| |00000840| 0c 7e 00 00 00 1c 00 5a | 00 02 4d 50 53 52 00 00 |.~.....Z|..MPSR..| |00000850| 00 1a 45 54 41 42 00 00 | 00 26 45 46 4e 54 00 00 |..ETAB..|.&EFNT..| |00000860| 00 32 03 ef ff ff 00 00 | 00 00 00 00 00 00 03 ec |.2......|........| |00000870| ff ff 00 00 00 18 00 42 | 17 a8 03 eb ff ff 00 00 |.......B|........| |00000880| 00 20 00 42 18 d0 00 00 | 00 00 00 00 00 00 00 00 |. .B....|........| |00000890| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |000008a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |000008b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |000008c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |000008d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |000008e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |000008f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| +--------+-------------------------+-------------------------+--------+--------+